home *** CD-ROM | disk | FTP | other *** search
- Path: solon.com!not-for-mail
- From: seebs@solutions.solon.com (Peter Seebach)
- Newsgroups: comp.lang.c
- Subject: Re: fastest code
- Date: 12 Apr 1996 07:46:28 -0500
- Organization: Usenet Fact Police (Undercover)
- Message-ID: <4kljb4$nm3@solutions.solon.com>
- References: <316112A2.7D37@public.sta.net.cn> <4kghs7$250@news1.mnsinc.com> <4kgu7g$n9a@solutions.solon.com> <yxsbukxemoi.fsf@stint.cl.cam.ac.uk>
- Reply-To: seebs@solon.com
- NNTP-Posting-Host: solutions.solon.com
-
- In article <yxsbukxemoi.fsf@stint.cl.cam.ac.uk>,
- Gareth Rees <gdr11@cl.cam.ac.uk> wrote:
- >Surely, under the `as if' rule, code that invokes undefined behaviour
- >*at any point* need not produce the results you expect even for those
- >portions that don't invoke undefined behaviour?
-
- True, although in practice it doesn't come up.
-
- >So in the case
-
- > int x[17], i;
- > for (i=0; i<16; i++) x[i] = x[i+i];
-
- >the compiler is perfectly at liberty to optimise away the loop body
- >because of the undefined behaviour of the whole program.
-
- Right. As it turns out, x had dimension 32 in the original post, but this
- was not posted along with the loop description.
-
- -s
- --
- Peter Seebach - seebs@solon.com - Copyright 1996 Peter Seebach.
- C/Unix wizard -- C/Unix questions? Send mail for help. No, really!
- FUCK the communications decency act. Goddamned government. [literally.]
- The *other* C FAQ - http://www.solon.com/~seebs/c/c-iaq.html
-